
**************
*** Fig. 1 ***
**************

* load frame
frame change italian_data

* N. of associations, dummy unemployment growth
reg mainstream i.worse_econ##c.associations##i.declining_emp i.education age i.male i.election_year i.provincen, vce(cluster province)

margins declining_emp, dydx(worse_econ) at(associations=(0(4)16))
mplotoffset,  offset(0.5) recast(scatter) ///
		title("") ///
		plotregion(style(none) color(gs16)) ///
		ytitle("Mainstream vote", size(large)) ///
		xtitle("Number of associations", size(large)) ///		
		yline(0, lw(thin) lstyle(foreground) ) ///
		ylabel(, grid glcolor(black%70) glw(thin) labs(medl)) ///
		xlabel(, nogrid) ///
		aspect(1) ///
		plot1opts(msymbol(D) msize(medium) mcolor(red) lcolor(red) lwidth(medthick)) ci1opts(lcolor(red)) ///
        plot2opts(msymbol(O) msize(medium) mcolor(blue) lp(solid)  mlcolor(blue) lcolor(blue) lwidth(medthick)) ci2opts(lcolor(blue)) ///
		legend( ///
			region(lwidth(none)) ///
			col(2) ///
			position(6) ///
			order(3 "Declining unemployment" 4 "Increasing unemployment"))
graph addplot histogram associations, ///
	yaxis(2) ///
	yscale(range(0 1) off axis(2)) ///
	xlabel(0(4)24) ///
	color(black%10) ///
	legend( ///
		region(lwidth(none)) ///
		col(2) ///
		position(6) ///
		order(3 "Declining unemployment" 4 "Increasing unemployment"))
graph export "$folder/replication/figures/fig1a.pdf", replace


* Logged n. of associations, dummy unemployment growth
reg mainstream i.worse_econ##c.log_associations##i.declining_emp i.education age i.male i.election_year i.provincen, vce(cluster province)

margins declining_emp, dydx(worse_econ) at(log_associations=(0.2(0.4)2.6))
mplotoffset,  offset(0.05) recast(scatter) ///
		title("") ///
		plotregion(style(none) color(gs16)) ///
		ytitle("Mainstream vote", size(large)) ///
		xtitle("Log-transformed n. of associations", size(large)) ///		
		yline(0, lw(thin) lstyle(foreground) ) ///
		ylabel(, grid glcolor(black%70) glw(thin) labs(medl)) ///
		xlabel(, nogrid) ///
		aspect(1) ///
		plot1opts(msymbol(D) msize(medium) mcolor(red) lcolor(red) lwidth(medthick)) ci1opts(lcolor(red)) ///
        plot2opts(msymbol(O) msize(medium) mcolor(blue) lp(solid)  mlcolor(blue) lcolor(blue) lwidth(medthick)) ci2opts(lcolor(blue)) ///
		legend( ///
			region(lwidth(none)) ///
			col(2) ///
			position(6) ///
			order(3 "Declining unemployment" 4 "Increasing unemployment"))
graph addplot histogram log_associations, ///
	yaxis(2) ///
	yscale(range(0 6) off axis(2)) ///
	xlabel(0.2(0.4)2.6) ///
	color(black%10) ///
	legend( ///
		region(lwidth(none)) ///
		col(2) ///
		position(6) ///
		order(3 "Declining unemployment" 4 "Increasing unemployment"))
			
graph export "$folder/replication/figures/fig1b.pdf", replace
	
* N. of sports club, dummy unemployment growth
reg mainstream i.worse_econ##c.coni_assoc_1999##i.declining_emp i.education age i.male i.election_year i.regionen, vce(cluster regionen)

margins declining_emp, dydx(worse_econ) at(coni_assoc_1999=(0.5(.4)2.1))
mplotoffset,  offset(0.05) recast(scatter) ///
		title("") ///
		plotregion(style(none) color(gs16)) ///
		ytitle("Mainstream vote", size(large)) ///
		xtitle("Number of sports clubs", size(large)) ///		
		yline(0, lw(thin) lstyle(foreground) ) ///
		ylabel(, grid glcolor(black%70) glw(thin) labs(medl)) ///
		xlabel(, nogrid) ///
		aspect(1) ///
		plot1opts(msymbol(D) msize(medium) mcolor(red) lcolor(red) lwidth(medthick)) ci1opts(lcolor(red)) ///
        plot2opts(msymbol(O) msize(medium) mcolor(blue) lp(solid)  mlcolor(blue) lcolor(blue) lwidth(medthick)) ci2opts(lcolor(blue)) ///
		legend( ///
			region(lwidth(none)) ///
			col(2) ///
			position(6) ///
			order(3 "Declining unemployment" 4 "Increasing unemployment"))
graph addplot histogram coni_assoc_1999, ///
	yaxis(2) ///
	yscale(range(0 6) off axis(2)) ///
	xlabel(0.5(.4)2.1) ///
	color(black%10) ///
	legend( ///
		region(lwidth(none)) ///
		col(2) ///
		position(6) ///
		order(3 "Declining unemployment" 4 "Increasing unemployment"))
graph export "$folder/replication/figures/fig1c.pdf", replace

* Logged n. of sports club, dummy unemployment growth

reg mainstream i.worse_econ##c.log_coni_assoc_1999##i.declining_emp i.education age i.male i.election_year i.regionen, vce(cluster regionen)

margins declining_emp, dydx(worse_econ) at(log_coni_assoc_1999=(0.4(0.4)1.2))
mplotoffset, offset(0.05) recast(scatter) ///
		title("") ///
		plotregion(style(none) color(gs16)) ///
		ytitle("Mainstream vote", size(large)) ///
		xtitle("Number of sports clubs", size(large)) ///		
		yline(0, lw(thin) lstyle(foreground) ) ///
		ylabel(, grid glcolor(black%70) glw(thin) labs(medl)) ///
		xlabel(, nogrid) ///
		aspect(1) ///
		plot1opts(msymbol(D) msize(medium) mcolor(red) lcolor(red) lwidth(medthick)) ci1opts(lcolor(red)) ///
        plot2opts(msymbol(O) msize(medium) mcolor(blue) lp(solid)  mlcolor(blue) lcolor(blue) lwidth(medthick)) ci2opts(lcolor(blue)) ///
		legend( ///
			region(lwidth(none)) ///
			col(2) ///
			position(6) ///
			order(3 "Declining unemployment" 4 "Increasing unemployment"))
graph addplot histogram log_coni_assoc_1999, ///
	yaxis(2) ///
	yscale(range(0 10) off axis(2)) ///
	xlabel(0.4(0.3)1.2) ///
	color(black%10) ///
	legend( ///
		region(lwidth(none)) ///
		col(2) ///
		position(6) ///
		order(3 "Declining unemployment" 4 "Increasing unemployment"))
graph export "$folder/replication/figures/fig1d.pdf", replace
